package com.itjeffrey.autocode.enums;

/**
 * 异常枚举类
 *
 * @From: Jeffrey
 * @Date: 2020/11/8
 */
public enum ExceptionEnum {

    UNKNOWN_ERROR(500, "未知异常！"),

    RESOURCE_NOT_FOUND(404, "资源未找到!"),

    NO_AUTH_TO_VISIT(403, "无权访问"),

    MODEL_TYPE_EXISTS_NULL(501, "请选择模板类型！"),

    UPLOAD_FILE_EXISTS_NULL(502, "上传文件为空！请重新上传！"),

    UPLOAD_DATASOURCE_FILE_EXCEED_SIZE(503, "数据源文件大小：{}，超过允许的最大值：{}，上传失败！"),

    FILE_SIZE_EXCEEDD(507, "单个文件上传大小不能超过：{}，上传失败！"),

    UPLOAD_FILE_ALREADY_EXISTS(504, "上传的文件已存在！"),

    UPLOAD_FILE_FAIL(505, "文件上传失败！"),

    UPLOAD_FILE_EXT_MISMATCH(506, "上传文件类型不匹配！"),

    CONNECTION_TIME_OUT(508, "连接已断开！"),

    DATABASE_OPERATE_FAILURE(509, "数据库操作失败！"),

    ONEKEY_GENERATE_FILE_FAILURE(510, "一键生成文档失败！"),

    FILE_EXPRESS_FAIL(511, "[数据源文件上传]文件解析失败！"),

    GET_CONN_FAIL(512, "[数据源文件上传]获取连接失败！"),

    USERNAME_OR_PASSWORD_EXISTS_NULL(513, "用户名或密码禁止为空！"),

    LOGIN_FAIL(515, "登陆失败！"),

    USER_NOT_FOUND(516, "用户不存在！"),

    USERNAME_OR_PASSWORD_ERROR(517, "用户名或密码错误！"),

    ACKPWD_FAIL(518, "确认密码与新密码不一致！"),

    OLDPWD_INPUT_ERROR(519, "原密码输入错误！"),

    LOGIN_INFO_NOT_EXISTS(520, "登录信息不存在！"),

    ACCESS_TOKEN_FAIL(521, "访问Token刷新失败！"),

    OLD_TOKEN_EXISTS_NULL(522, "原Token为空！"),

    TOKEN_EXPIRED(523, "Token已失效，请重新登录！"),

    TOKEN_CLAIMS_HANDLE_FAIL(524, "Token声明解析失败！"),

    ACCESS_TOKEN_UN_EXPIRE(525, "访问Token未失效！状态异常！"),

    REFRESH_TOKEN_EXPIRE(526, "刷新Token已失效！请重新登录"),

    REFRESH_TOKEN_UN_EXPIRE(527, "刷新Token未失效！状态异常！"),

    //528

    AVATER_UPLOAD_FAIL(529, "头像上传失败！"),

    ALREADY_LOGTOUT(530, "您已登出，请重新登录！"),

    PARAM_ERROR(531, "参数错误！"),

    //532

    FILE_MODULE_NOT_EXISTS(533, "文件模板不存在！"),

    FILE_MODULE_DOWNLOAD_FAIL(534, "文件模板下载失败！"),

    SOME_PARAM_EXISTS_NULL(535, "参数[{}]为空！"),

    SOME_PARAM_HAS_EXISTS(536, "参数[{}]已存在！"),

    CONNECTION_NOT_FOUND(537, "连接不存在！"),

    TABLE_NAME_IS_NULL(538, "表名禁止为空！"),

    COLUMN_NAME_IS_NULL(539, "字段名禁止为空！"),

    ARGUMENT_VALIDATE_ERROR(540, "参数校验失败!"),

    MOCK_INTERFACE_HAS_EXISTS(541, "接口数据已存在，请勿重复新增！"),

    MOCK_INTERFACE_NOT_EXISTS(542, "接口数据未登记！"),

    RESP_PARAMS_FORMAT_ERROR(543, "响应参数格式有误！"),

    RESP_PARAMS_KEY_ERROR(544, "响应参数key不支持包含[{}]特殊字符!"),

    PLACEHOLDER_POSITION_ERROR(545, "占位符[{}]位置请置于首位！"),

    AFTER_PLACEHOLDER_EXISTS_NULL(546, "占位符[{}]后请键入关键字！"),

    PLACEHOLDER_COUNT_EXCEED(547, "占位符[{}]个数不能超过1"),

    JSON_ANALYSE_ERROR(548, "JSON解析失败！"),

    MOCK_KEYWORD_PISITION_ERROR(549, "MOCK关键符位置不正确！"),

    MOCK_PARAM_ERROR(550, "MOCK参数有误！"),

    PARAM_ANALYSE_ERROR(551, "MOCK参数解析失败！"),

    PARAM_TYPE_INVALID(552, "参数类型无效！"),

    PROCESS_MODEL_EXISTS_NULL(553, "模板数据为空"),

    PROCESS_DEPLOY_FAIL(554, "部署异常"),

    PMENU_INFO_EXISTS_NULL(555, "路径为{}的父菜单信息不存在"),

    DEPLOY_INFO_EXISIS_NULL(556, "部署信息不存在"),

    PROCESS_DEFINITION_INFO_EXISIS_NULL(557, "流程定义信息不存在"),

    PROCESS_TASK_IS_NULL(558, "流程任务为空"),

    TEMPLATE_PARSE_ERROR(559, "模板解析异常"),

    TEMPLATE_GET_ERROR(560, "模板获取失败"),

    JOB_STATE_GET_FAIL(561, "任务状态获取失败"),

    JOB_STATE_ERROR(562, "任务正在运行中，不允许删除"),

    INNER_SERVICE_ERROR_WITH_REASON(563, "内部服务错误！原因：{}"),

    INNER_SERVICE_ERROR(564, "内部服务错误！"),

    PARAM_EXISTS_NULL(565, "参数为空！"),

    DBSOURCE_GET_FAILURE(566, "数据源获取失败！"),

    DB_LINK_GET_FAILED(567, "数据库获取连接失败！"),

    DATA_SOURCE_INSERT_FAILURE(568, "数据源入库失败！"),

    DATA_SOURCE_UPDATE_FAILURE(569, "数据源更新失败！"),

    CONN_META_DATA_GET_FAIL(570, "数据库连接元数据获取失败！"),

    CRON_EXPRESSION_INVALID(571, "无效的CRON表达式"),

    JOB_ADD_ERROR(572, "任务新增失败"),

    JOB_MOD_ERROR(573, "任务更新失败"),

    ;

    private Integer errorCode;
    private String errorMessage;

    public Integer getErrorCode() {
        return errorCode;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    ExceptionEnum(Integer errorCode, String errorMessage) {
        this.errorCode = errorCode;
        this.errorMessage = errorMessage;
    }

}
